package com.grace.cms.forum.record.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.grace.cms.forum.record.domain.CmsCollectRecord;
import com.grace.cms.forum.record.domain.CmsLikeRecord;
import com.grace.cms.forum.record.domain.CmsNastyRecord;
import com.grace.cms.forum.record.domain.CmsScoreRecord;
import com.grace.cms.forum.record.domain.CmsShareRecord;
import com.grace.cms.forum.record.domain.vo.CmsRecordVo;
import com.grace.cms.forum.record.mapper.CmsRecordMapper;
import com.grace.cms.forum.record.service.ICmsRecordService;

import io.jsonwebtoken.lang.Assert;

import com.grace.cms.common.domain.entity.CmsRecordCount;
import com.grace.cms.common.domain.entity.CmsLookRecord;

/**
 * 文章统计Service业务层处理
 * 
 * @author zg
 * @date 2020-04-06
 */
@Service
public class CmsRecordServiceImpl implements ICmsRecordService {

    @Autowired
    private CmsRecordMapper cmsRecordMapper;

    @Override
    public CmsRecordCount selectCmsRecordCountById(String recordId,String themeName,String OnlyCode) {
        Assert.hasText(recordId, "文章ID不能为空");
        Assert.hasText(themeName, "主题名称不能为空");
        Assert.hasText(OnlyCode, "站点唯一编码不能为空");
        return cmsRecordMapper.selectCmsRecordCountById(recordId,themeName,OnlyCode);
    }

    @Override
    public List<CmsRecordCount> listCmsRecordCount(String recordId, String themeName,String OnlyCode) {
        return cmsRecordMapper.listCmsRecordCount(recordId, themeName,OnlyCode );
    }

    @Override
    public List<CmsCollectRecord> listCollectRecord(CmsCollectRecord collectRecord) {
        return cmsRecordMapper.listCollectRecord(collectRecord);
    }

    @Override
    public List<CmsLikeRecord> listLikeRecord(CmsLikeRecord likeRecord) {
        return cmsRecordMapper.listLikeRecord(likeRecord);
    }

    @Override
    public List<CmsLookRecord> listLookRecord(CmsLookRecord lookRecord) {
        return cmsRecordMapper.listLookRecord(lookRecord);
    }

    @Override
    public List<CmsNastyRecord> listNastyRecord(CmsNastyRecord nastyRecord) {
        return cmsRecordMapper.listNastyRecord(nastyRecord);
    }

    @Override
    public List<CmsScoreRecord> listScoreRecord(CmsScoreRecord scoreRecord) {
        return cmsRecordMapper.listScoreRecord(scoreRecord);
    }

    @Override
    public List<CmsShareRecord> listShareRecord(CmsShareRecord shareRecord) {
        return cmsRecordMapper.listShareRecord(shareRecord);
    }

    @Override
    public CmsRecordVo selectCmsRecordVo(String recordId, String createBy,String themeName,String onlyCode) {
        return cmsRecordMapper.selectCmsRecordVo(recordId, createBy,themeName,onlyCode);
    }

}
